home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 1.6 KB | 71 lines | [TEXT/MPS ] |
- // UMouseDocument.cp
- // Copyright © 1992 by Apple Computer, Inc. All rights reserved.
- // Kent Sandvik DTS
- // This file contains the basic TMouseDocument member functions
- // Version Info (latest first):
- //
- // <1> khs 1.0 First final version
- // <2> khs 1.0.1 Fixed a memory leak in TMapApplication::GetSleepValue()
-
-
- // INCLUDES
- #ifndef __MOUSEDOCUMENT__
- #include "UMouseDocument.h" // class definitions
- #endif
-
-
- // CLASS METHODS
- // Empty constructor - for avoiding ptabs in global data space
- #pragma segment ARes
- TMouseDocument::TMouseDocument()
- {
- }
-
-
- // Create TMouseDocument
- #pragma segment AInit
- pascal void TMouseDocument::IMouseDocument()
- {
- inherited::IDocument();
- }
-
-
- // Free any resources attached to the TMouseDocument - yes it's empty, but one never
- // knows if one could place something here, so I have it added. Yes, it wastes CPU
- // cycles...
- #pragma segment AClose
- pascal void TMouseDocument::Free()
- {
- inherited::Free();
- }
-
-
- // Create any needed TMouseDocument Views
- #pragma segment AOpen
- pascal void TMouseDocument::DoMakeViews(Boolean /*forPrinting*/)
- {
- TWindow * aWindow = NULL;
- FailInfo fi;
-
- if (fi.Try())
- {
- // create main information window
- aWindow = (TWindow *)gViewServer->NewTemplateWindow(kMainWindow, this);
- fMainView = (TView *)aWindow->FindSubView('vie1');
-
- // add frame adorner for the document
- fMainView->AddAdorner(NewStdAdorner('afra', "", 'afra', kFreeOnDeletion), kDrawView, kRedraw);
-
- // add mouse tracking behaviors
- TMouseTrackBehavior * theBehavior = new TMouseTrackBehavior;
- theBehavior->IMouseTrackBehavior(mMouseTrack);
- this->AddBehavior(theBehavior);
-
- fi.Success();
- }
- else
- fi.ReSignal();
- }
-
-
-